<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Builder::XmlEvents</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Builder::XmlEvents</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/activesupport/lib/active_support/vendor/builder-2_1_2/builder/xmlevents_rb.html">
                vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="XmlMarkup.html">
                XmlMarkup
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Create a series of SAX-like XML events (e.g. start_tag, end_tag) from the
markup code. XmlEvent objects are used in a way similar to <a
href="XmlMarkup.html">XmlMarkup</a> objects, except that a series of events
are generated and passed to a handler rather than generating
character-based markup.
</p>
<p>
Usage:
</p>
<pre>
  xe = Builder::XmlEvents.new(hander)
  xe.title(&quot;HI&quot;)    # Sends start_tag/end_tag/text messages to the handler.
</pre>
<p>
Indentation may also be selected by providing value for the indentation
size and initial indentation level.
</p>
<pre>
  xe = Builder::XmlEvents.new(handler, indent_size, initial_indent_level)
</pre>
<h2>XML Event Handler</h2>
<p>
The handler object must expect the following events.
</p>
<dl>
<dt><tt>start_tag(tag, attrs)</tt></dt><dd>Announces that a new tag has been found. <tt>tag</tt> is the name of the
tag and <tt>attrs</tt> is a hash of attributes for the tag.

</dd>
<dt><tt>end_tag(tag)</tt></dt><dd>Announces that an end tag for <tt>tag</tt> has been found.

</dd>
<dt><tt>text(text)</tt></dt><dd>Announces that a string of characters (<tt>text</tt>) has been found. A
series of characters may be broken up into more than one <tt>text</tt>
call, so the client cannot assume that a single callback contains all the
text data.

</dd>
</dl>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000911">_end_tag</a>&nbsp;&nbsp;
      <a href="#M000910">_start_tag</a>&nbsp;&nbsp;
      <a href="#M000909">text!</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000911" class="method-detail">
        <a name="M000911"></a>

        <div class="method-heading">
          <a href="#M000911" class="method-signature">
          <span class="method-name">_end_tag</span><span class="method-args">(sym)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000911-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000911-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb, line 58</span>
58:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_end_tag</span>(<span class="ruby-identifier">sym</span>)
59:       <span class="ruby-ivar">@target</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-identifier">sym</span>)
60:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000910" class="method-detail">
        <a name="M000910"></a>

        <div class="method-heading">
          <a href="#M000910" class="method-signature">
          <span class="method-name">_start_tag</span><span class="method-args">(sym, attrs, end_too=false)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000910-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000910-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb, line 53</span>
53:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_start_tag</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">end_too</span>=<span class="ruby-keyword kw">false</span>)
54:       <span class="ruby-ivar">@target</span>.<span class="ruby-identifier">start_tag</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">attrs</span>)
55:       <span class="ruby-identifier">_end_tag</span>(<span class="ruby-identifier">sym</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">end_too</span>
56:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000909" class="method-detail">
        <a name="M000909"></a>

        <div class="method-heading">
          <a href="#M000909" class="method-signature">
          <span class="method-name">text!</span><span class="method-args">(text)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000909-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000909-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb, line 49</span>
49:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text!</span>(<span class="ruby-identifier">text</span>)
50:       <span class="ruby-ivar">@target</span>.<span class="ruby-identifier">text</span>(<span class="ruby-identifier">text</span>)
51:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>